{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import keras"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline  \n",
    "#让图片直接生成在当前界面"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "x = np.linspace(0,100,30)\n",
    "y = 3*x + 7 + np.random.randn(30)*10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x21c912799e8>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFHZJREFUeJzt3XGs1ed93/H3p8Rzb5Np2DNDcIHhacwTrhUzHVneqKYs\nWYebTYP6D4tI7ZBmif7hdckUeYL2j7aaKjOldTdpdSTaZGFbEhc1LkZp1MzBkSJVjZ1L8RqDw8xq\nu+EGG7qUJZuQa5Pv/rg/wjEG7jn3nHPPOb/7fklX95zn/M45zyObDz++v9/zPKkqJEnt9SPj7oAk\nabQMeklqOYNeklrOoJekljPoJanlDHpJajmDXpJazqCXpJYz6CWp5d4z7g4A3HHHHbV58+Zxd0OS\npsrx48f/vKrWLHbcRAT95s2bmZubG3c3JGmqJHmtl+Ms3UhSyxn0ktRyBr0ktZxBL0ktZ9BLUstN\nxF03ktQGR07M84kvn+Y7Fy+xfvUMj+64i13bZsfdLYNekobhyIl59j/1TS69dRmA+YuX2P/UNwHG\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Lh+lNbx9vtRmM8CuxOcmuSO4EtwPND+caqmtof4MPA/wT+F/CL4+7PiMb4Eyz80+5PgBea\nnw8Df52FK/YvA18Bbh93X0cw9g8AX2wer4Tx3gvMNf+tjwC3tXncwK8A3wJeBP4rcGvbxgt8noVr\nEG+x8K+2h282RuAXmzw7DfzUsPrhzFhJarlpLt1Iknpg0EtSyxn0ktRyBr0ktZxBL0ktZ9BLUssZ\n9JLUcga9JLXc/wfl1tAhDpZBPQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x21c912092b0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:kr]",
   "language": "python",
   "name": "conda-env-kr-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
